export function addEventListen(
    target: Element,
    event: keyof DocumentEventMap,
    handler: <K extends keyof DocumentEventMap>(this: Element, ev: DocumentEventMap[K]) => any,
    capture = false
) {
    if (target.addEventListener && typeof target.addEventListener === "function") {
        target.addEventListener(event, handler, capture);
    }
}
export function removeEventListen(
    target: Element,
    event: keyof DocumentEventMap,
    handler: <K extends keyof DocumentEventMap>(this: Document, ev: DocumentEventMap[K]) => any,
    capture = false
) {
    if (target.removeEventListener && typeof target.removeEventListener === "function") {
        target.removeEventListener(event, handler, capture);
    }
}
